package com.java.business.controller;

import com.java.business.model.Expenditure;
import com.java.business.service.ExpenditureService;
import com.java.common.model.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/expenditure")
public class ExpenditureController {

    @Autowired
    private ExpenditureService expenditureService;

    @PostMapping("/list")
    @ResponseBody
    public Result list(@RequestBody Expenditure expenditure) {
        return expenditureService.list(expenditure);
    }

    @PostMapping("/save")
    @ResponseBody
    public Result save(@RequestBody Expenditure expenditure) {
        return expenditureService.save(expenditure);
    }

    @PostMapping("/saveList")
    @ResponseBody
    public Result saveList(@RequestBody Expenditure expenditure) {
        return expenditureService.saveList(expenditure);
    }

    @PostMapping("/modify")
    @ResponseBody
    public Result modify(@RequestBody Expenditure expenditure) {
        return expenditureService.modify(expenditure);
    }

    @PostMapping("/remove")
    @ResponseBody
    public Result remove(int[] ids) {
        return expenditureService.remove(ids);
    }





}
